function disableSelection(targetClass) {
  $$(targetClass).each(function(target) {
		if (typeof target.onselectstart!="undefined") //IE route
		    target.onselectstart=function(){return false}
		else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
		    target.style.MozUserSelect="none"
		else //All other route (ie: Opera)
		    target.onmousedown=function(){return false}
		target.style.cursor = "default";
  });
}

function needToScroll(el) {
    var parent = el.parentNode;
    var top = el.getPosition(parent).y;
    var scrolled = parent.getScroll().y;
    var bottom = top+el.getSize().y;
    var parentBottom = scrolled+parent.getSize().y;
    
    return top < scrolled || bottom + 100 > parentBottom;
}

function isEnterKey(e) {
    var key;      
    if(window.event) {
        key = window.event.keyCode; //IE
    }
    else {
        key = e.which; //firefox
    }      
    return (key == 13);
}